<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      >
      <div class="panier">
		<div class="title">Panier</div>
		<h:panelGroup rendered="#{mbPanier.size>0}">
		<h:form>
		<ul>
		<li class="header">
			<span class="nom">Spectacle</span>
			<span class="quantite">Quantité</span>
			<span class="pu">Prix Unitaire</span>
			<span class="total">Prix Total</span>
			<span class="action">Action</span>
		</li>
		<ui:repeat var="res" value="#{mbPanier.reservationsVues}">
		<li class="content">
			<span class="nom">#{res.reservation.seance.spectacle.spectacleDonnees.nom}</span>
			<span class="quantite">#{res.reservation.quantite}
				<h:commandButton value="+" actionListener="#{mbPanier.ajQtte}">
							<f:attribute name="resId" value="#{res.idPanier}"/>
						</h:commandButton>
						<h:commandButton value="-" actionListener="#{mbPanier.supQtte}">
							<f:attribute name="resId" value="#{res.idPanier}"/>
						</h:commandButton>
			</span>
			<span class="pu"><h:outputText value="#{res.reservation.prixTTC}">
							<f:convertNumber maxFractionDigits="2"/>
						</h:outputText>	</span>
			<span class="total"><h:outputText value="#{res.prixReservation}">
							<f:convertNumber maxFractionDigits="2"/>
						</h:outputText>	</span>
			<span class="action">
						<h:commandButton actionListener="#{mbPanier.supprimer}" value="Supprimer">
							<f:attribute name="resId" value="#{res.idPanier}"/>
						</h:commandButton>
						</span>
						
		</li>
		
		</ui:repeat>
		<li class="total">
		<span class="label">Prix Total </span>
		<span class="value"><h:outputText value="#{mbPanier.prixTotal}">
					<f:convertNumber maxFractionDigits="2"/>
				</h:outputText>
				<h:outputText value=" euros"/></span>
				<br/>
				
				
		</li>
		</ul>
		<div class="commander"><h:commandButton disabled="#{mbPanier.size==0}" value="Valider la commande" action="#{mbPanier.valider}"/></div>
		</h:form>
		</h:panelGroup>

				<h:panelGroup rendered="#{mbPanier.size==0}">
				Votre panier est vide
				</h:panelGroup>
				</div>

</html>